package com.cjack.frenchexcel.dao;

import com.cjack.frenchexcel.table.CooperativeNumberTable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * Created by root on 10/5/19
 */
public interface CooperativeNumberDao extends JpaRepository<CooperativeNumberTable, Long>, JpaSpecificationExecutor<CooperativeNumberTable> {
    CooperativeNumberTable getByNumber( String number);
    CooperativeNumberTable getByCodeHt20Rule( String codeHt20Rule);
    CooperativeNumberTable getByCodeHt10Rule( String codeHt10Rule);
    CooperativeNumberTable getByCodeHt5Rule( String codeHt5Rule);
    CooperativeNumberTable getByCodeHt2Rule( String codeHt2Rule);
    List<CooperativeNumberTable> getByName(String name);
    CooperativeNumberTable getByNameAndJobNumber(String name, String jobNumber);
    CooperativeNumberTable getByJobNumber(String jobNumber);
    List<CooperativeNumberTable> findAllByNameRuleLikeAndIdNot( String nameRule, Long id);
    List<CooperativeNumberTable> findAllByNameRuleLike( String nameRule);
    List<CooperativeNumberTable> findAllByNameRuleLikeAndIdRuleLike( String nameRule, String idRule);
    List<CooperativeNumberTable> findAllByJobNumber(String jobNumber);
    CooperativeNumberTable findByJobNumberAndNumber(String jobNumber, String number);
    CooperativeNumberTable findByJobNumberAndName(String jobNumber, String name);

}
